﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using Wicresoft.Framework.Organization;
using System.Xml;

/// <summary>
/// Summary description for EJDBasePage
/// </summary>
public class EJDBasePage : Page
{
    protected override void OnInit(EventArgs e)
    {
        if (Session["muser"] == null)
        {
            ejiading.PlatService p = new ejiading.PlatService();
            string a = p.getUserInfoByTM_Token(Tid);
          //  string a = @"<?xml version=""1.0"" encoding=""utf-8"" ?>
//<UserInfo>
 // <ID>1ce32414-6d9b-4bff-b7e1-fb4e3ef0f056</ID>
 // <Name>chenxinn</Name>
 // <DisplayName>陈鑫(N)</DisplayName>
 // <Gender>男</Gender>
 // <MainDepartmentID>4ecbecb1-03e4-4d6b-ae1d-95a281d4b43c</MainDepartmentID>
//  <photo>98830091-c89e-431e-8be6-997931d9bcb6.jpg</photo>
//</UserInfo>";
              _currentinfo = CommonMethod.Instance.SerializableXML<UserInfo>(a);
              HttpContext.Current.Session["muser"] = _currentinfo;
        }
        else

            _currentinfo = (UserInfo)HttpContext.Current.Session["muser"];

        base.OnInit(e);
    }
    public EJDBasePage()
    {
       
    }

    public string Tid
    {
        get
        {

            return Request["tid"] ?? string.Empty;
        }

    }

    private UserInfo _currentinfo = new UserInfo();
    public UserInfo CurrentUser
    {
        get
        {
            return _currentinfo;
        }
    }
}
